﻿<Window x:Class="QLHH.DSHoaDonWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Hoá đơn bán hàng" Height="350" Width="700" Loaded="Window_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <ToolBarTray  Grid.Row="0"  >
            <ToolBar Band="1" BandIndex="1">
                <Button  Name="mnNew" ToolTip="New" Click="mnNew_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image HorizontalAlignment="right"  Source="Images/NewDocumentHS.png"/>
                        <TextBlock  VerticalAlignment="Center">Thêm mới</TextBlock>
                    </StackPanel>
                </Button>
                <Button ToolTip="Edit" Name ="btEdit"  Click="btEdit_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="16" Height="16" Source="Images/Properties.png"/>
                        <TextBlock  VerticalAlignment="Center">Sửa</TextBlock>
                    </StackPanel>
                </Button>
                <Button ToolTip="Delete" Name="btDelete" Click="btDelete_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="16" Height="16" Source="Images/DeleteHS.png"/>
                        <TextBlock  VerticalAlignment="Center">Xóa</TextBlock>
                    </StackPanel>
                </Button>
                <Separator/>
                <Button ToolTip="Find">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="16" Height="16" Source="Images/Find_VS.png"/>
                        <TextBlock  VerticalAlignment="Center">Tìm kiếm</TextBlock>
                    </StackPanel>
                </Button>
                <Button ToolTip="Print" Name="btPrint" Click="btPrint_Click" >
                    <StackPanel Orientation="Horizontal">
                        <Image Width="16" Height="16" Source="Images/PrintHS.png"/>
                        <TextBlock  VerticalAlignment="Center">In</TextBlock>
                    </StackPanel>
                </Button>
                <Separator/>
                <Button ToolTip="Close" Name="btClose" Click="btClose_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="16" Height="16" Source="Images/StopHS.png"  />
                        <TextBlock  VerticalAlignment="Center">Thoát</TextBlock>
                    </StackPanel>
                </Button>
            </ToolBar>
        </ToolBarTray>

        <DataGrid Name="datagrid" Grid.Row="1" AutoGenerateColumns="False">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Số hóa đơn" Width="100" Binding="{Binding sohd}"></DataGridTextColumn>
                <DataGridTextColumn Header="Tên hàng" Width="150" Binding="{Binding tenhang}"></DataGridTextColumn>
                <DataGridTextColumn Header="Số lượng" Width="80"  Binding="{Binding soluong, StringFormat={}{0:N0}}"></DataGridTextColumn>
                <DataGridTextColumn Header="Đơn giá" Width="80" Binding="{Binding dongia, StringFormat={}{0:N0}}"></DataGridTextColumn>
                <DataGridTextColumn Header="Trị giá" Width="80" Binding="{Binding trigia, StringFormat={}{0:N0} }"></DataGridTextColumn>
                <DataGridTextColumn Header="Khuyến mãi" Width="80" Binding="{Binding khuyenmai, StringFormat={}{0:N0}}"></DataGridTextColumn>
                <DataGridTextColumn Header="Diễn giải" Width="200" Binding="{Binding diengiai}"></DataGridTextColumn>
            </DataGrid.Columns>
        </DataGrid>

        <StatusBar Grid.Row="2">
            <StatusBarItem Name="sbiShd" Content="Tổng số hóa đơn: 05"/>
        </StatusBar>
    </Grid>
</Window>
